package com.xsz.service;

import com.xsz.entity.RoleUserKey;
import com.xsz.entity.User;
import com.xsz.mapper.RoleUserMapper;
import com.xsz.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class RoleUserService {
    @Resource
    RoleUserMapper roleUserMapper;

    //根据用户id查询角色
    public String selectById(String uid) {
        RoleUserKey ru=roleUserMapper.selectByUid(uid);
        if(ru.getRoleId().equals("2")){
            return "求职者";
        }else{
            return "企业";
        }
    }

    //新建
    public int insert(RoleUserKey record){
        return roleUserMapper.insert(record);
    }
}
